<template>
  <div class="wrap">
    <div class="top">
      <div class="pledgee-name">
        <span>补发变更/转让/续展证明申请</span>
      </div>

      <div class="pledgee-msg">
        <div class="top-left">
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">申请人名称 ：</span>
              <el-input v-if="control" v-model="applicant" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{applicant}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">申请人地址 ：</span>
              <el-input v-if="control" v-model="appliAddr" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{appliAddr}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">邮政编码 ：</span>
              <el-input v-if="control" v-model="postCode" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{postCode}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">联系人 ：</span>
              <el-input v-if="control" v-model="applicant" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{applicant}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">邮箱 ：</span>
              <el-input v-if="control" v-model="email" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{email}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">电话 ：</span>
              <el-input v-if="control" v-model="phone" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{phone}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">代理机构名称 ：</span>
              <el-input v-if="control" v-model="deptName" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{deptName}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">商标注册号 ：</span>
              <el-input v-if="control" v-model="appNum" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{appNum}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text" style="height:100%">补发证明事项 ：</span>
              <!-- <div v-if="control" style="width:100%;padding-left:30px">
                <el-radio v-model="remark" label="0">变更证明</el-radio>
                <el-radio v-model="remark" label="1">转让证明</el-radio>
                <el-radio v-model="remark" label="2">续展证明</el-radio>
              </div> -->
              <span class="parallelism">
                <div class="overstrikingg">
                  <el-checkbox :checked="remark==0?true:false" v-if="remark==0?true:false" disabled>
                    <span class="overstriking">变更证明</span>
                  </el-checkbox>
                  <div v-if="remark==0?true:false">
                    <div
                      class="form-menu"
                      style="flex-direction: row;align-items: center;"
                    >
                      <span class="form-menu-text">变更前注册人名义（地址） ：</span>
                      <span class="parallelism">{{beforeRegistChange}}</span>
                    </div>
                    <div
                      class="form-menu"
                      style="flex-direction: row;align-items: center;"
                    >
                      <span class="form-menu-text">变更后注册人名义（地址） ：</span>
                      <span class="parallelism">{{afterRegistChange}}</span>
                    </div>
                  </div>
                </div>
                <div class="overstrikingg">
                  <el-checkbox :checked="remark==1?true:false" v-if="remark==1?true:false" disabled>
                    <span class="overstriking">转让证明</span>
                  </el-checkbox>
                  <div v-if="remark==1?true:false">
                    <div
                      class="form-menu"
                      style="flex-direction: row;align-items: center;"
                    >
                      <span class="form-menu-text" style="width:18%">转让人名称 ：</span>
                      <span class="parallelism">{{transferorName}}</span>
                    </div>
                    <div
                      class="form-menu"
                      style="flex-direction: row;align-items: center;"
                    >
                    <!-- display: flex;margin-left:18px -->
                      <span class="form-menu-text" style="width:18%">受让人名称 ：</span>
                      <span class="parallelism">{{transfereesName}}</span>
                    </div>
                  </div>
                </div>
                <div class="overstrikingg">
                  <el-checkbox :checked="remark==2?true:false" v-if="remark==2?true:false" disabled>
                    <span class="overstriking" >续展证明</span>
                  </el-checkbox>
                  <div v-if="remark==2?true:false">
                    <div
                      class="form-menu"
                      style="flex-direction: row;align-items: center;"
                    >
                      <span class="form-menu-text" style="width:18%">注册有效期：</span>
                      <span class="parallelism">{{datexs[0]}} 至 {{datexs[1]}}</span>
                    </div>
                    <span style="font-size:14px;color:rgb(104,104,104)">(以上具体事项如未填写，视为补发该项最近一次业务证明)</span>
                  </div>
                </div>
              </span>
              <!-- <div class="overstrikingg">
                          <div class="yyimgLyear" >
                            <img style="width:500px" :src='newUrl(busimg)' alt="">
                          </div>
                          <div class="idCardImgBox" v-if="imgShow"  >
                              <img style="width:350px;margin-top:5px;" :src='newUrl(idcardface)' alt=""> 
                          </div>
              </div>-->
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left" style="margin-top:10px">
              <span class="form-menu-text" style="margin-left:-1%">营业执照 :</span>
              <span class="parallelism">
               <imgshow> <img style="width:500px;margin-top:10px;margin-left:10px" :src="newUrl(busimg)" alt /></imgshow>
              </span>
            </div>
          </div>
          <div class="form-menu" v-if="appliType == 1">
            <div class="form-menu-left">
              <span class="form-menu-text">身份证 :</span>
              <span class="parallelism">
               <imgshow> <img style="width:350px;margin-top:5px;margin-left:10px" :src="newUrl(idcardface)" alt /></imgshow>
              </span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left" style="margin-top:10px">
              <span class="form-menu-text" style="margin-left:-1%">网上确认书 :</span>
              <span class="parallelism">
               <imgshow> <img style="width:500px;margin-top:10px;margin-left:10px" :src="newUrl(qrfile)" alt /></imgshow>
              </span>
            </div>
          </div>
          <!--<div class="form-menu" v-if="otherfile != []">-->
          <div class="form-menu" v-if="otherfile.length>0">
            <div class="form-menu-left">
              <span class="form-menu-text" style="margin-left:-1%">其他附件 :</span>
              <span class="parallelism">
                <imgshow v-for="(item,index) in otherfile" :key="index">
                  <img :src="newUrl(item)" style="width:500px;margin-top:10px;margin-left:10px" class="yybox" alt="">
                </imgshow>
              </span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import imgshow from '../common/imgshow'
export default {
  components:{
    imgshow
  },
  data() {
    return {
      datexs:[],
      datex:"",
      yearx:"",
      appliType: "",
      imgShow: true,
      afterRegistChange: "", //   变更后注册人名称
      deptName: "", //   代理机构名称
      appliAddr: "", //   申请人地址
      applicant: "", //   申请人名称
      appNum: "", //   商标注册号
      beforeRegistChange: "", //   变更前注册人名称
      branchNetworkId: "", //   网点编号
      contacts: "", //   联系人
      email:"",//电子邮箱
      otherfile:[],
      id: "",
      imgPath: [
        {
          url:
            "http://api_devs.wanxikeji.cn/app/pic/20200811/20200811014058945.jpg",
        },
        {
          url:
            "http://api_devs.wanxikeji.cn/app/pic/20200811/20200811013904718.jpg",
        },
      ], //   图片地址
      phone: "", //   电话
      postCode: "", //   邮政编码
      proAppendJson: "", //   共享人 json
      registValidity: "", //   注册有效期
      remark: "", //   补发证明事项
      subStatus: "", //   状态
      transfereesName: "", //   受让人名称
      transferorName: "", //   转让人名称
      userId: "", //   用户id
      busimg: "",
      idcardface: "",
      qrfile:"",//网上确认书
      control: false, //   控制标签的显示
      options: [
        { value: 0, label: "企业" },
        { value: 1, label: "个人" },
      ],
      optionss: [
        { value: 1, label: "保存" },
        { value: 2, label: "通过" },
        { value: 3, label: "未通过" },
        { value: 4, label: "未审核" },
      ],
      dialogVisible: false,
      disabledd: false,
      remarkk: "", //   补发证明事项(页面展示)
      subStatuss: "", //   状态(页面展示)
    };
  },
  methods: {
    newImgStatus() {
      if (this.idcardface || this.idcardimg) {
      } else {
        this.imgShow = false;
      }
      console.log(this.imgShow);
    },
    newUrl(_url) {
      //图片地址
      var newURL = this.mconfig.host + _url;
      // console.log(_url);
      return newURL;
    },
    genre() {
      ////console.log(this.appliType)
    },
    notarizeAmend() {
      if (this.control) {
        this.control = false;
        ////console.log(this.control)
      } else {
        this.control = true;
        ////console.log(this.control)
      }
    },
    handleExceed(files, fileList) {
      //   图片地址
      this.disabledd = true;
      let a = "http://api_devs.wanxikeji.cn/" + files.data;
      this.imgPath.push(a);
      // ////console.log(this.imgPath)
    },
    handlePictureCardPreview(file) {
      //  上传图片的放大显示
      this.imgPath = file.url;
      this.dialogVisible = true;
      //  ////console.log('www',file)
    },
    handleRemove(file) {
      //  上传图片的删除
      ////console.log(file);
      this.disabledd = false;
      this.$refs.upload.clearFiles();
    },
    add(val) {
      this.$http
        .get("/trademark/proafo/findByIdDetl", {
          params: {
            id: val,
          },
        })
        .then((res) => {
          this.appliType = res.data.data.data.appliType;
          this.qrfile = res.data.data.data.qrfile;//网上确认书
          this.idcardface = res.data.data.data.idcardface;
          this.email = res.data.data.data.email;//电子邮箱
          this.applicant = res.data.data.data.applicant; //   申请人名称（中文）
          this.appliAddr = res.data.data.data.appliAddr; //   申请人地址（中文）
          this.postCode = res.data.data.data.postCode; //  邮政编码
          this.contacts = res.data.data.data.contacts; //  联系人
          this.phone = res.data.data.data.phone; //  电话
          this.deptName = res.data.data.data.deptName; //  代理机构
          this.appNum = res.data.data.data.registNum; //  商标注册号
          this.busimg = res.data.data.data.busimg; 
          this.otherfile = JSON.parse(res.data.data.data.otherfile);
          // console.log(this.busimg)
          this.remark = res.data.data.data.remark; //  补发证明事项
          this.beforeRegistChange = res.data.data.data.beforeRegistChange; //  变更前驻车人名称
          this.afterRegistChange = res.data.data.data.afterRegistChange; //  变后前驻车人名称
          this.transferorName = res.data.data.data.transferorName; //  转让人名称
          this.transfereesName = res.data.data.data.transfereesName; //  受让人名称
          this.registValidity = res.data.data.data.registValidity; //  注册有效期限
          // 注册有效期
          let s = this.registValidity.split(",")
            for(let i = 0;i < s.length;i++){
              this.datex = new Date(s[i]);
              this.yearx = this.datex.getFullYear() + '-' + (this.datex.getMonth()+1) + '-' + this.datex.getDate();
              this.datexs.push(this.yearx)
            }
        });
    },
  },
  watch: {
    control(val) {
      if (val) {
      } else {
        if (this.remark == 0) {
          this.remarkk = "变更证明";
        } else if (this.remark == 1) {
          this.remarkk = "转让证明";
        } else if (this.remark == 2) {
          this.remarkk = "续展证明";
        }

        if (this.subStatus == 1) {
          this.subStatuss = "保存";
        } else if (this.subStatus == 2) {
          this.subStatuss = "通过";
        } else if (this.subStatus == 3) {
          this.subStatuss = "未通过";
        } else if (this.subStatus == 4) {
          this.subStatuss = "未审核";
        }
      }
      ////console.log(this.appliType,this.isComm,this.subStatus)
    },
  },
  mounted() {
    let aa = this.$route.query.id;
    this.add(aa);
  },
};
</script>


<style scoped>
body,
div,
a,
p,
span,
ul,
li {
  padding: 0;
  margin: 0;
}
div {
  box-sizing: border-box;
}
img {
  max-width: 100%;
  max-height: 100%;
}
a {
  text-decoration: none;
}
.wrap {
  padding: 20px 20px;
  position: relative;
}
.amend-btn {
  position: absolute;
  top: 8%;
  right: 10%;
}
.buttona {
  color: #fff;
  padding: 8px 15px;
  border-radius: 5px;
  background: rgba(0, 0, 255, 0.5);
}
.buttona:hover {
  background: rgba(0, 0, 255, 0.8);
}
.top {
  /* 质权人信息部分  */
  min-width: 1200px;
  /* margin: 0 auto; */
  padding: 10px 5px;
  /* border: 1px solid blue; */
}
.pledgee-name {
  /* 质权人信息部分整体框架  */

  text-align: left;
  font-size: 25px;
  font-weight: normal;
  margin-bottom: 30px;
  margin-left: 300px;
}
.dashed-text {
  /* 质权人信息部分的标题  */
  font-size: 17px;
  font-weight: bold;
  color: rgb(100, 100, 100);
}
.dashed {
  /* 质权人信息部分的内容  */
  width: 50%;
  margin-left: 10px;
  border-top: 1px dashed rgb(204, 204, 204);
}
.pledgee-msg {
  margin-left: -30px;
  /* 内容部分的整体框架  */
  width: 100%;
  /* border: 1px solid blue; */
}
.top-left {
  /* 内容的左边部分  */

  text-align: left;
  margin-left: 160px;
}
.form-menu {
  /*  每行内容的显示  */
  line-height: 32px;
  /* padding: 2px 0; */
  /* border: 1px solid red; */
}
.form-menu-left {
  display: flex;
  /* flex-direction: row; */
  /* align-items: center; */
}
.form-menu-right {
  width: 40%;
  display: flex;
  flex-direction: row;
  align-items: center;
}
.form-menu-text {
  /*  每行内容文本的css样式的显示  */
  width: 320px;
  text-align: right;
  color: rgb(140, 140, 140);
}
.parallelism {
  width: 100%;
  /* padding: 10.2px 0; */
}
.el-input /deep/ .el-input__inner {
  color: #000;
  height: 38px;
}

.el-select {
  width: 700px;
}
.el-select-dropdown__item {
  padding-left: 20px;
}

/* 新版本样式 */
.stamp {
  width: 30%;
  height: 220px;
  font-size: 15px;
  text-align: center;
  /* border: 1px solid red; */
}
.agent {
  width: 100%;
  text-align: right;
  margin-right: 25%;
}
.follower {
  padding: 50px 0 0 0;
}
.follower-title {
  text-align: center;
  /* font-weight: bold; */
  font-size: 25px;
}
.follower-title-text {
  font-size: 16px;
  font-weight: normal;
  display: inline-block;
  padding: 20px 0 15px 0;
}
.follower-matter-frame {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 20%;
  margin-bottom: 20px;
}
.seal {
  color: rgb(104, 104, 104);
}
.follower-matter-text {
  width: 320px;
  font-size: 15px;
  text-align: right;
  padding: 10px 0px;
}
/* .overstrikingg {
  margin: 5px 0 0 0;
} */
.overstriking {
  font-size: 15px;
  font-weight: bold;
  color: rgb(56, 56, 56);
}
.depth {
  width: 70%;
  /* border: 1px solid red; */
}
</style>